<template>
	<TheHeader></TheHeader>
	<router-view />
</template>

<script>
	import TheHeader from './components/TheHeader.vue';
	import {
		setCookie,
		setCookie2,
		clearCookie,
		getCookie
	} from "./utils/cookie";
	export default {
		components: {
			TheHeader,
		},
		data() {
			return {

			}
		},
		created() {
			const _this = this;
			let currentRouter = getCookie("currentRouter");
			if (currentRouter == null || currentRouter == "" || currentRouter == "/") {
				let curR = _this.$route.path;
				if (curR == "/") {
					currentRouter = "/mainhome";
				} else {
					currentRouter = curR;
				}
				setCookie2("currentRouter", currentRouter);
			} 
			_this.$router.replace(currentRouter);
		}
	}
</script>

<style lang="less">
	* {
		margin: 0;
		padding: 0;
		box-sizing: border-box;
	}

	#app {
		width: 100%;
		height: 100%;
		align-items: center;
		font-family: Avenir, Helvetica, Arial, sans-serif;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		text-align: center;
		color: #2c3e50;
		background: #efefef;
		position: fixed;
		// overflow-x: auto;
	}
</style>
